<?php

namespace app\common\service\organization;

use app\common\model\banxi\organization\OrganizationData;
use app\common\service\ApiService;

class OrganizationDataService extends ApiService
{
    public function getByOrganization($organizationId)
    {
        $organizationData = new OrganizationData();
        return $organizationData->where('organizationId', $organizationId)->find();
    }

    public function updateQuotaNum($organizationId, $beforeValue, $afterValue)
    {
        $organizationData = new OrganizationData();
        return $organizationData->update(['partnerQuotaNum' => $afterValue], [
            'organizationId' => $organizationId,
            'partnerQuotaNum' => $beforeValue
        ]);
    }
}
